package Month09.day0928;



public class TestCopy implements Cloneable{
    String name;

    public TestCopy(String name) {
        this.name = name;
    }

    @Override
    public TestCopy clone() {
        TestCopy o = null;
        try {
            o = (TestCopy) super.clone();
        } catch (CloneNotSupportedException e) {
            e.printStackTrace();
        }
        return o;
    }
    @Override
    public String toString(){
        String s ="[" + this.name + "]";
        return s;
    }
    public static void main(String[] args) {
        TestCopy t1 = new TestCopy("测试一");
        TestCopy t2 = t1.clone();
        System.out.println(t1);
        System.out.println(t2);
    }
}
